<template>
	<el-dialog width="99%" :close-on-click-modal="false" v-model="dialogVisible" :title="state.title" destroy-on-close :before-close="handleClose">
		<BarCode ref="BarcodeRef" />
		<template #footer>
			<el-button type="primary" @click="printTag">打印</el-button>
		</template>
	</el-dialog>
</template>
<script lang="ts" setup  name="copyDialog">
const state = reactive({
	title: '',
});
const dialogVisible = ref(false);
const BarcodeRef = ref();
// 打开弹窗
const openDialog = async (type) => {
	if (type === '1') {
		state.title = '打印产品条码';
	} else if (type === '2') {
		tate.title = '打印FNSKU条码';
	}
	dialogVisible.value = true;
};
// 关闭弹窗
const handleClose = () => {
	dialogVisible.value = false;
};
defineExpose({
	openDialog,
});
onMounted(() => {});
</script>
<style scoped>
</style>
